<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Lowin</title>
    <link rel="stylesheet" href="/css/auth.css">
    <script src="/js/jquery-1.4.4.min.js"></script>
</head>

<body>
<div class="lowin">
    <div class="lowin-brand">
        <img src="/images/kodinger.jpg" alt="logo">
    </div>
    <div class="lowin-wrapper">
        <div class="lowin-box lowin-login">
            <div class="lowin-box-inner">
                <form name="frm" method="post" action="/admin/login">
                    <input id="eon" type="hidden" />
                    <p>登陆继续操作</p>
                    <div class="lowin-group">
                        <label>邮箱或用户名 <a href="#" class="login-back-link"></a></label>
                        <input type="text" autocomplete="email" name="emailOrLoginName" class="lowin-input"
                               placeholder="请输入邮箱或用户名">
                    </div>
                    <div class="lowin-group password-group">
                        <label>密码</label>
                        <input type="password" name="password" placeholder="请输入密码" autocomplete="current-password"
                               class="lowin-input">
                    </div>
                    <div class="lowin-group">
                    </div>
                    <button class="lowin-btn login-btn" type="button" onclick="doSubmit()">
                        点击登陆
                    </button>
                </form>
            </div>
        </div>
    </div>

</div>

<script>
    function doSubmit() {
        var login = frm.emailOrLoginName.value
        if (login.length == 0 || login == "") {
            alert("请输入用户名或邮箱地址")
            return
        }
        $("#eon").attr("value", login)
        var reg = /[@]+/
        if (reg.test(login)) {
            $("#eon").attr("name", "email")
        } else {
            $("#eon").attr("name", "loginname")
        }
        var pwd = frm.password.value
        if (pwd.length == 0 || pwd == "") {
            alert("请输入密码")
            return
        }
        frm.submit()
    }
</script>
</body>
</html>